from django.core.management.base import BaseCommand
from service.report_generator import ScheduleReportGenerator


class Command(BaseCommand):
    help = 'Generate medical procedures count report in Excel'

    def add_arguments(self, parser):
        parser.add_argument('year', type=int, help='Year for the report')
        parser.add_argument('month', type=int, help='Month for the report')

    def handle(self, *args, **kwargs):
        year = kwargs['year']
        month = kwargs['month']
        report_generator = ScheduleReportGenerator(year, month)
        report_generator.generate_report()
        self.stdout.write(self.style.SUCCESS(f'Report successfully generated: {report_generator.filename}'))
